#/*
# * EuhatRtsp
# * 
# * Copyright (c) 2014-2018 Euhat.com euhat@hotmail.com
# * Copyright (c) ffmpeg
# * Copyright (c) live555
# *
# * File name: Application.mk
# * 
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# *  You may obtain a copy of the License at
# * 
# *     http://www.apache.org/licenses/LICENSE-2.0
# * 
# *  Unless required by applicable law or agreed to in writing, software
# *  distributed under the License is distributed on an "AS IS" BASIS,
# *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# *  See the License for the specific language governing permissions and
# *  limitations under the License.
# * 
#*/

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := avcodec
LOCAL_SRC_FILES := ../ffmpeg/lib/libavcodec-58.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := swresample
LOCAL_SRC_FILES := ../ffmpeg/lib/libswresample-3.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := avutil
LOCAL_SRC_FILES := ../ffmpeg/lib/libavutil-56.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)

CFLAGS := -Werror

LOCAL_C_INCLUDES := \
		$(LOCAL_PATH)/ \
		$(LOCAL_PATH)/BasicUsageEnvironment/include/ \
		$(LOCAL_PATH)/groupsock/include/ \
		$(LOCAL_PATH)/liveMedia/include/ \
		$(LOCAL_PATH)/livevideo/ \
		$(LOCAL_PATH)/UsageEnvironment/include/ \
		$(LOCAL_PATH)/../ffmpeg/include/ 

LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%)
LOCAL_CFLAGS += -DANDROID_NDK
LOCAL_CFLAGS += -DLOG_NDEBUG
LOCAL_CFLAGS += -DEUHAT_DBG
LOCAL_CFLAGS += -DACCESS_RAW_DESCRIPTORS
LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays -fexceptions

LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl 
LOCAL_LDLIBS += -llog
LOCAL_LDLIBS += -landroid
#LOCAL_LDLIBS += -lmediandk

LOCAL_SHARED_LIBRARIES += avcodec avutil swresample

LOCAL_ARM_MODE := arm

LOCAL_SRC_FILES := \
		BasicUsageEnvironment/BasicHashTable.cpp \
		BasicUsageEnvironment/BasicTaskScheduler.cpp \
		BasicUsageEnvironment/BasicTaskScheduler0.cpp \
		BasicUsageEnvironment/BasicUsageEnvironment.cpp \
		BasicUsageEnvironment/BasicUsageEnvironment0.cpp \
		BasicUsageEnvironment/DelayQueue.cpp \
		groupsock/GroupEId.cpp \
		groupsock/Groupsock.cpp \
		groupsock/GroupsockHelper.cpp \
		groupsock/inet.c \
		groupsock/IOHandlers.cpp \
		groupsock/NetAddress.cpp \
		groupsock/NetInterface.cpp \
		liveMedia/AC3AudioFileServerMediaSubsession.cpp \
		liveMedia/AC3AudioRTPSink.cpp \
		liveMedia/AC3AudioRTPSource.cpp \
		liveMedia/AC3AudioStreamFramer.cpp \
		liveMedia/ADTSAudioFileServerMediaSubsession.cpp \
		liveMedia/ADTSAudioFileSource.cpp \
		liveMedia/AMRAudioFileServerMediaSubsession.cpp \
		liveMedia/AMRAudioFileSink.cpp \
		liveMedia/AMRAudioFileSource.cpp \
		liveMedia/AMRAudioRTPSink.cpp \
		liveMedia/AMRAudioRTPSource.cpp \
		liveMedia/AMRAudioSource.cpp \
		liveMedia/AudioInputDevice.cpp \
		liveMedia/AudioRTPSink.cpp \
		liveMedia/AVIFileSink.cpp \
		liveMedia/Base64.cpp \
		liveMedia/BasicUDPSink.cpp \
		liveMedia/BasicUDPSource.cpp \
		liveMedia/BitVector.cpp \
		liveMedia/ByteStreamFileSource.cpp \
		liveMedia/ByteStreamMemoryBufferSource.cpp \
		liveMedia/ByteStreamMultiFileSource.cpp \
		liveMedia/DarwinInjector.cpp \
		liveMedia/DeviceSource.cpp \
		liveMedia/DigestAuthentication.cpp \
		liveMedia/DVVideoFileServerMediaSubsession.cpp \
		liveMedia/DVVideoRTPSink.cpp \
		liveMedia/DVVideoRTPSource.cpp \
		liveMedia/DVVideoStreamFramer.cpp \
		liveMedia/EBMLNumber.cpp \
		liveMedia/FileServerMediaSubsession.cpp \
		liveMedia/FileSink.cpp \
		liveMedia/FramedFileSource.cpp \
		liveMedia/FramedFilter.cpp \
		liveMedia/FramedSource.cpp \
		liveMedia/GSMAudioRTPSink.cpp \
		liveMedia/H261VideoRTPSource.cpp \
		liveMedia/H263plusVideoFileServerMediaSubsession.cpp \
		liveMedia/H263plusVideoRTPSink.cpp \
		liveMedia/H263plusVideoRTPSource.cpp \
		liveMedia/H263plusVideoStreamFramer.cpp \
		liveMedia/H263plusVideoStreamParser.cpp \
		liveMedia/H264or5VideoFileSink.cpp \
		liveMedia/H264or5VideoRTPSink.cpp \
		liveMedia/H264or5VideoStreamDiscreteFramer.cpp \
		liveMedia/H264or5VideoStreamFramer.cpp \
		liveMedia/H264VideoFileServerMediaSubsession.cpp \
		liveMedia/H264VideoFileSink.cpp \
		liveMedia/H264VideoRTPSink.cpp \
		liveMedia/H264VideoRTPSource.cpp \
		liveMedia/H264VideoStreamDiscreteFramer.cpp \
		liveMedia/H264VideoStreamFramer.cpp \
		liveMedia/H265VideoFileServerMediaSubsession.cpp \
		liveMedia/H265VideoFileSink.cpp \
		liveMedia/H265VideoRTPSink.cpp \
		liveMedia/H265VideoRTPSource.cpp \
		liveMedia/H265VideoStreamDiscreteFramer.cpp \
		liveMedia/H265VideoStreamFramer.cpp \
		liveMedia/InputFile.cpp \
		liveMedia/JPEGVideoRTPSink.cpp \
		liveMedia/JPEGVideoRTPSource.cpp \
		liveMedia/JPEGVideoSource.cpp \
		liveMedia/Locale.cpp \
		liveMedia/MatroskaDemuxedTrack.cpp \
		liveMedia/MatroskaFile.cpp \
		liveMedia/MatroskaFileParser.cpp \
		liveMedia/MatroskaFileServerDemux.cpp \
		liveMedia/MatroskaFileServerMediaSubsession.cpp \
		liveMedia/Media.cpp \
		liveMedia/MediaSession.cpp \
		liveMedia/MediaSink.cpp \
		liveMedia/MediaSource.cpp \
		liveMedia/MP3ADU.cpp \
		liveMedia/MP3ADUdescriptor.cpp \
		liveMedia/MP3ADUinterleaving.cpp \
		liveMedia/MP3ADURTPSink.cpp \
		liveMedia/MP3ADURTPSource.cpp \
		liveMedia/MP3ADUTranscoder.cpp \
		liveMedia/MP3AudioFileServerMediaSubsession.cpp \
		liveMedia/MP3AudioMatroskaFileServerMediaSubsession.cpp \
		liveMedia/MP3FileSource.cpp \
		liveMedia/MP3Internals.cpp \
		liveMedia/MP3InternalsHuffman.cpp \
		liveMedia/MP3InternalsHuffmanTable.cpp \
		liveMedia/MP3StreamState.cpp \
		liveMedia/MP3Transcoder.cpp \
		liveMedia/MPEG1or2AudioRTPSink.cpp \
		liveMedia/MPEG1or2AudioRTPSource.cpp \
		liveMedia/MPEG1or2AudioStreamFramer.cpp \
		liveMedia/MPEG1or2Demux.cpp \
		liveMedia/MPEG1or2DemuxedElementaryStream.cpp \
		liveMedia/MPEG1or2DemuxedServerMediaSubsession.cpp \
		liveMedia/MPEG1or2FileServerDemux.cpp \
		liveMedia/MPEG1or2VideoFileServerMediaSubsession.cpp \
		liveMedia/MPEG1or2VideoRTPSink.cpp \
		liveMedia/MPEG1or2VideoRTPSource.cpp \
		liveMedia/MPEG1or2VideoStreamDiscreteFramer.cpp \
		liveMedia/MPEG1or2VideoStreamFramer.cpp \
		liveMedia/MPEG2IndexFromTransportStream.cpp \
		liveMedia/MPEG2TransportFileServerMediaSubsession.cpp \
		liveMedia/MPEG2TransportStreamFramer.cpp \
		liveMedia/MPEG2TransportStreamFromESSource.cpp \
		liveMedia/MPEG2TransportStreamFromPESSource.cpp \
		liveMedia/MPEG2TransportStreamIndexFile.cpp \
		liveMedia/MPEG2TransportStreamMultiplexor.cpp \
		liveMedia/MPEG2TransportStreamTrickModeFilter.cpp \
		liveMedia/MPEG2TransportUDPServerMediaSubsession.cpp \
		liveMedia/MPEG4ESVideoRTPSink.cpp \
		liveMedia/MPEG4ESVideoRTPSource.cpp \
		liveMedia/MPEG4GenericRTPSink.cpp \
		liveMedia/MPEG4GenericRTPSource.cpp \
		liveMedia/MPEG4LATMAudioRTPSink.cpp \
		liveMedia/MPEG4LATMAudioRTPSource.cpp \
		liveMedia/MPEG4VideoFileServerMediaSubsession.cpp \
		liveMedia/MPEG4VideoStreamDiscreteFramer.cpp \
		liveMedia/MPEG4VideoStreamFramer.cpp \
		liveMedia/MPEGVideoStreamFramer.cpp \
		liveMedia/MPEGVideoStreamParser.cpp \
		liveMedia/MultiFramedRTPSink.cpp \
		liveMedia/MultiFramedRTPSource.cpp \
		liveMedia/OggDemuxedTrack.cpp \
		liveMedia/OggFile.cpp \
		liveMedia/OggFileParser.cpp \
		liveMedia/OggFileServerDemux.cpp \
		liveMedia/OggFileServerMediaSubsession.cpp \
		liveMedia/OggFileSink.cpp \
		liveMedia/OnDemandServerMediaSubsession.cpp \
		liveMedia/ourMD5.cpp \
		liveMedia/OutputFile.cpp \
		liveMedia/PassiveServerMediaSubsession.cpp \
		liveMedia/ProxyServerMediaSession.cpp \
		liveMedia/QCELPAudioRTPSource.cpp \
		liveMedia/QuickTimeFileSink.cpp \
		liveMedia/QuickTimeGenericRTPSource.cpp \
		liveMedia/rtcp_from_spec.c \
		liveMedia/RTCP.cpp \
		liveMedia/RTPInterface.cpp \
		liveMedia/RTPSink.cpp \
		liveMedia/RTPSource.cpp \
		liveMedia/RTSPClient.cpp \
		liveMedia/RTSPCommon.cpp \
		liveMedia/RTSPRegisterSender.cpp \
		liveMedia/RTSPServer.cpp \
		liveMedia/RTSPServerSupportingHTTPStreaming.cpp \
		liveMedia/ServerMediaSession.cpp \
		liveMedia/SimpleRTPSink.cpp \
		liveMedia/SimpleRTPSource.cpp \
		liveMedia/SIPClient.cpp \
		liveMedia/StreamParser.cpp \
		liveMedia/StreamReplicator.cpp \
		liveMedia/T140TextRTPSink.cpp \
		liveMedia/TCPStreamSink.cpp \
		liveMedia/TextRTPSink.cpp \
		liveMedia/TheoraVideoRTPSink.cpp \
		liveMedia/TheoraVideoRTPSource.cpp \
		liveMedia/uLawAudioFilter.cpp \
		liveMedia/VideoRTPSink.cpp \
		liveMedia/VorbisAudioRTPSink.cpp \
		liveMedia/VorbisAudioRTPSource.cpp \
		liveMedia/VP8VideoRTPSink.cpp \
		liveMedia/VP8VideoRTPSource.cpp \
		liveMedia/VP9VideoRTPSink.cpp \
		liveMedia/VP9VideoRTPSource.cpp \
		liveMedia/WAVAudioFileServerMediaSubsession.cpp \
		liveMedia/WAVAudioFileSource.cpp \
		livevideo/CustomMediaSession.cpp \
		livevideo/librtspsource.cpp \
		livevideo/RawRTPSource.cpp \
		livevideo/RTSPSource.cpp \
		livevideo/SPSParser.cpp \
		livevideo/CommonOp.cpp \
		livevideo/DecodeOp.cpp \
		livevideo/DecoderSoft.cpp \
		livevideo/DecoderHard.cpp \
		livevideo/RtspOp.cpp \
		UsageEnvironment/HashTable.cpp \
		UsageEnvironment/strDup.cpp \
		UsageEnvironment/UsageEnvironment.cpp 

LOCAL_MODULE := EuhatRtsp
include $(BUILD_SHARED_LIBRARY)
